package imooc;

public class demo3 {
    public static void main(String[] args) {
        int[] scores = {61, 23, 4, 74, 13, 148, 20};
        int max = scores[0], min = scores[0], sum = 0;
        double avg;
        for (int i = 0; i < scores.length; i++) {
            if (scores[i] > max) {
                max = scores[i];
            }
            if (scores[i] < min) {
                min = scores[i];
            }
            sum += scores[i];
        }
        avg = sum / scores.length;
        System.out.println("数组中的最大值:" + max);
        System.out.println("数组中的最小值:" + min);
        System.out.println("数组中的平均值:" + avg);

    }

}
